namespace Aurora.RabbitMq.Provider;

/// <summary>
/// Serializer
/// </summary>
public interface IRabbitMqSerializer
{
    /// <summary>
    /// 序列化
    /// </summary>
    /// <param name="obj"></param>
    /// <returns></returns>
    byte[] Serialize(object obj);


    /// <summary>
    /// Deserialize
    /// </summary>
    /// <param name="value"></param>
    /// <param name="type"></param>
    /// <returns></returns>
    object? Deserialize(byte[] value, Type type);

    /// <summary>
    /// Deserialize
    /// </summary>
    /// <param name="value"></param>
    /// <typeparam name="T"></typeparam>
    /// <returns></returns>
    T? Deserialize<T>(byte[] value);
}